﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Data;
using System.Runtime.Serialization;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace Abreu.Profile.ObjectClasses
{
    [Serializable]
    public class AbreuLocationInfo
    {
        #region Class Members
        private int _abreuLocationId;
        private String _name;
        private String _address;
        private String _local;
        private String _postalCode;
        private String _postalLocal;
        private String _email;
        private String _phone;
        private String _fax;
        private int? _cityId;
        private int? _countryId;
        private int? _distritoId;
        private int? _concelhoId;
        private String _city;
        private String _country;
        private String _distrito;
        private String _concelho;
        private Char _status;
        private String _nuts3;
        private String _nuts3Code;
        private Binary _version;
        #endregion 

        #region Properties
        public int AbreuLocationId
        {
            get { return _abreuLocationId; }
            set { _abreuLocationId = value; }
        }

        public String LocationName
        {
            get { return _name; }
            set { _name = value; }
        }

        public String Address
        {
            get { return _address; }
            set { _address = value; }
        }

        public String Local
        {
            get { return _local; }
            set { _local = value; }
        }

        public String PostalCode
        {
            get { return _postalCode; }
            set { _postalCode = value; }
        }

        public String PostalLocal
        {
            get { return _postalLocal; }
            set { _postalLocal = value; }
        }

        public String Email
        {
            get { return _email; }
            set { _email = value; }
        }

        public String Phone
        {
            get { return _phone; }
            set { _phone = value; }
        }

        public String Fax
        {
            get { return _fax; }
            set { _fax = value; }
        }

        public int? CityId
        {
            get { return _cityId; }
            set { _cityId = value; }
        }

        public int? CountryId
        {
            get { return _countryId; }
            set { _countryId = value; }
        }

        public int? DistritoId
        {
            get { return _distritoId; }
            set { _distritoId = value; }
        }

        public int? ConcelhoId
        {
            get { return _concelhoId; }
            set { _concelhoId = value; }
        }

        public String Cidade
        {
            get { return _city; }
            set { _city = value; }
        }

        public String País
        {
            get { return _country; }
            set { _country = value; }
        }

        public String Distrito
        {
            get { return _distrito; }
            set { _distrito = value; }
        }

        public String Concelho
        {
            get { return _concelho; }
            set { _concelho = value; }
        }

        public Char Status
        {
            get { return _status; }
            set { _status = value; }
        }

        public String Nuts3
        {
            get { return _nuts3; }
            set { _nuts3 = value; }
        }

        public String Nuts3Code
        {
            get { return _nuts3Code; }
            set { _nuts3Code = value; }
        }

        public Binary Version
        {
            get { return _version; }
            set { _version = value; }
        }
        #endregion

        #region Constructor
        public AbreuLocationInfo(int abreuLocationId, String name, String address, String local, String postalCode,
                                 String postalLocal, String email, String phone, String fax, int? cityId, int? countryId,
                                 int? distritoId, int? concelhoId, Char status, Binary version, String nuts3)
        {
            AbreuLocationId = abreuLocationId;
            LocationName = name;
            Address = address;
            Local = local;
            PostalCode = postalCode;
            PostalLocal = postalLocal;
            Email = email;
            Phone = phone;
            Fax = fax;
            CityId = cityId;
            CountryId = countryId;
            DistritoId = distritoId;
            ConcelhoId = concelhoId;
            Status = status;
            Version = version;
            Nuts3 = nuts3;
        }

        public AbreuLocationInfo(int abreuLocationId, String name, String address, String local, String postalCode,
                                String postalLocal, String email, String phone, String fax, String city, int? cityId, 
                                String country, int? countryId, String distrito, int? distritoId, String concelho, int? concelhoId,
                                Char status, Binary version, String nuts3, String nuts3Code)
        {
            AbreuLocationId = abreuLocationId;
            LocationName = name;
            Address = address;
            Local = local;
            PostalCode = postalCode;
            PostalLocal = postalLocal;
            Email = email;
            Phone = phone;
            Fax = fax;
            Cidade = city;
            País = country;
            Distrito = distrito;
            Concelho = concelho;
            ConcelhoId = concelhoId;
            CityId = cityId;
            CountryId = countryId;
            DistritoId = distritoId;
            Status = status;
            Version = version;
            Nuts3 = nuts3;
            Nuts3Code = nuts3Code;
        }

         public AbreuLocationInfo(int abreulocationId, String name, String local, String city, String country,
                                 String distrito, String concelho, Char status, String nuts3)
        {
            AbreuLocationId = abreulocationId;
            LocationName = name;
            Local = local;
            Cidade = city;
            País = country;
            Distrito = distrito;
            Concelho = concelho;
            Status = status;
            Nuts3 = nuts3;
        }

        public AbreuLocationInfo()
        {
        }

        public AbreuLocationInfo Clone()
        {
            MemoryStream ms = new MemoryStream();
            BinaryFormatter bf = new BinaryFormatter();

            bf.Serialize(ms, this);

            ms.Position = 0;
            object obj = bf.Deserialize(ms);
            ms.Close();

            return obj as AbreuLocationInfo;
        } 

	    #endregion
    }
}
